#include <stdio.h>
#include <math.h>
#define PI 3.14159

double deg_to_radians (double angle ) ;
double length_third_side (double side1 , double side2 , double RadAngle);
double calculateArea (double side1 , double side2 , double side3 );
int main () {
double area , RadAngle ,side3 , s , side1 , side2 , angle; 


printf ("Enter the length of side1 [cm]: ");
scanf ("%lf",&side1);
printf ("Enter the length of side2 [cm]: ");
scanf ("%lf",&side2);
printf ("Enter the angle in degrees between side1 and side2: ");
scanf ("%lf",&angle);


RadAngle = deg_to_radians ( angle );
side3 = length_third_side ( side1 ,side2 , RadAngle);

area = calculateArea ( side1 ,  side2 ,  side3);

printf ("The area of the triangle = %.2lf square cm" , area);
return 0;
}

double deg_to_radians (double angle ) {
	double RadAngle;
	RadAngle = angle * PI / 180;
	return RadAngle;
}

double length_third_side (double side1 , double side2 , double RadAngle) {
	double side3 ;
	side3 = sqrt (side1 * side1 + side2 * side2 - (2 * side1 * side2 * cos (RadAngle)));
	return side3;
}

double calculateArea (double side1 , double side2 , double side3 ) {
	
	double area , s;
	s = (side1+side2+side3) / 2;
	area = sqrt( s* (s-side1) * (s-side2)* (s-side3)) ;
	return area;
}



